-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
!!! Migrate to doctrine/migration v3 #23
!!! Migrate to doctrine/migration v3 #23
Conversation
* Implement a DependencyFactory for TYPO3 * Get rid of DoctrineService * Get rid of overwriting the now "final class" *Command from doctrine:migrate * Wire the dependencies in Services.yaml * Get rid of obsolete Commands.php * Add new commands introduced with doctrine/migrations v3: - migrations:dump-schema - migrations:generate - migrations:latest - migrations:list - migrations:up-to-date !!! Compatibility Notes: * `--dry-run` is currently not supported anymore for the "AbstractDataHandlerMigration" * An upgrade in the doctrine_migrationstatus is required, see README.md
To transform the version column from single version to fully qualified classname. See https://github.com/doctrine/migrations/blob/3.6.x/UPGRADE.md
9b5247d
to
ef0aef7
Compare
@kaystrobach @andreaswolf just FYI, we have been using this branch for some time now in production with success. |
with PHP 8. | ||
|
||
After running the Database Compare migrations, don't forget to run the Upgrade Wizards which will | ||
migrate the table `migration_statustable`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
migration_statustable
is the name of the wizard, not the table, right? This is not really understandable here IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. But I understand it :)
|
||
/** | ||
* Implements a doctrine/migration ConfigurationLoader with a TYPO3 specific flavour | ||
* - Adds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems there's something missing here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For sure.. If I recall correctly I changed a lots of things in this loader which I noted when I started to try to document it. And then forgot to come back to it.
By reading the code, I think this description would seem appropriate:
* - Configure table `doctrine_migrationstatus` as where to store our migration status
* - Adds relevant TYPO3 specific paths where to search migrations:
* 1. `var/migrations/` and
* 2. `Migrations/Mysql` paths inside all active extensions
* Migrates the version number in the `doctrine_migrationstatus` table | ||
* | ||
* Transforms version number (i.e. '20230912174700') in column "version" | ||
* to the fully qualified classname as expected for doctrine/migrate v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… for doctrine/migrations v3, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right!
``` | ||
|
||
This extension uses `doctrine/migrations` to migrate the database tables. | ||
Replace the `@namespace` setting with the namespace of your extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which setting? I could not find any other mention of @namespace
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is obsolete, it was overseen and should have been deleted when I introduced the upgrade wizard (which does this automatically). See this commit: ef0aef7
This completes the open PR #20.
Makes the migrations work again with doctrine/migration v3. See also https://github.com/doctrine/migrations/blob/3.6.x/UPGRADE.md
Changes
*Command
classes from doctrine/migrate which are nowfinal
Services.yaml
Commands.php
Compatibility Notes:
--dry-run
is currently not supported anymore for the "AbstractDataHandlerMigration"Resolves #12